package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class WindowPartitionColumnReference {

    private int beginIndex;
    private int endIndex;
    private ColumnReference columnReference;
    private CollateClause collateClause;

    public WindowPartitionColumnReference(ColumnReference columnReference,
                                          CollateClause collateClause) {
        this.beginIndex = columnReference.getBeginIndex();
        if (collateClause != null) {
            this.endIndex = collateClause.getEndIndex();
        } else {
            this.endIndex = columnReference.getEndIndex();
        }
        this.columnReference = columnReference;
        this.collateClause = collateClause;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public ColumnReference getColumnReference() {
        return columnReference;
    }

    public CollateClause getCollateClause() {
        return collateClause;
    }

}
